#define  _CRT_SECURE_NO_WARNINGS

#include<iostream>
#include<string.h>

using namespace std;

int main()
{
    char arr[501] = { 0 };
    cin >> arr;
    char* str = (char*)malloc(sizeof(char) * 500);
    int count = 0, k = 0;
    for (int i = 0; i < strlen(arr);)
    {
        count = 0;
        for (int j = i; arr[i] == arr[j]; j++)
        {
            count++;
        }
        str[k++] = arr[i];
        str[k++] = count + '0';
        i += count;
    }
    if (strlen(str) > strlen(arr))
    {
        cout << "NO" << endl;
    }
    else
    {
        cout << str << endl;
    }

    return 0;
}